#pragma once
#include "Bit.h"
#include "omvanla.h"
#include <iostream>
#include <string>
using namespace std;
class Bitstr
{
public:
	void addstr(string &astr,string &bstr, string &sumstr)
	{
		/*omvanla om;
		int x, y;
		x= om.str_tal(astr);
		y= om.str_tal(bstr);
		z = x +y;
		cout << z << endl;*/
		Bit b;
		char ci ,cu, sum;
		ci = '0';
		sumstr = "    ";
		for (int i = astr.length()-1; i >= 0 ; i--)
		{
			b.add(astr[i], bstr[i],ci,sum , cu);
			sumstr[i] = sum;
		}


	}
	void twokomp(string &str)
	{
		Bit b;
		Bitstr b1;

		for (int i = str.length()-1 ; i >= 0; i--)
		{
			str[i]= b.not(str[i]);
		}
		string a = "0001";
		b1.addstr(str,a,str);
	}
};